/*
 * TcpSocketViewerProtocol.h
 *
 *  Created on: May 25, 2011
 *      Author: madboyka
 */

#ifndef TCPSOCKETVIEWERPROTOCOL_H_
#define TCPSOCKETVIEWERPROTOCOL_H_

#include "ViewerProtocol.h"
#include <QString>
#include <QVector>
#include <stdio.h>

class TcpSocketViewerProtocol: public ViewerProtocol {
public:
	TcpSocketViewerProtocol();
	~TcpSocketViewerProtocol();
	int receive();
	float* getLocationData();
	void bind();
	void close();
	void connect(QString);
	ViewerProtocol* acceptConnection();
	void sendMessage(int, int);
	void sendObjects(const void*,int);
	void waitRequest();
	void sendRequest();
	int getCount();
	void PrintMatrixSexy(float*);
	ElementData getNewElement(int);
	void writeElementData(const ElementData);
	ElementData readElementData();
private:
	TcpSocketViewerProtocol(int);
	int socket;
	int count;
	float *ldata;
	QVector<ElementData> newElements;
};

#endif /* TCPSOCKETVIEWERPROTOCOL_H_ */
